package main //程序的包名 可手动设置

import (
	"fmt"
	"time"
)

//main 函数
func main() {

	fmt.Println("你好")
	time.Sleep(100)
	fmt.Println("你好")
	aa()
}

func aa() {

	var name string = "nihao"
	fmt.Printf("type of name =  %T\n", name)

	var b int = 100
	fmt.Printf("type of b = %T\n", b)

	//自动类型判断
	var a = 100
	fmt.Printf("type of a = %T\n", a)

	var bb string = "abcd"
	fmt.Printf("bb is %s, bb type of %T\n", bb, bb)

	//常用方法：省去var 定义关键字 直接自动匹配
	//但是 此用法只能在方法局部中使用
	e := 100
	//int
	fmt.Printf("e` type of %T\n", e)

	f := "fddfds"
	//string
	fmt.Printf("f` type of f is %T\n", f)

	g := 3.1255
	//float64
	fmt.Printf("g` type of is %T\n", g)

	//同时声明多个变量
	var xx, yy int = 222, 3333
	fmt.Println(xx, yy)
	var kk, ll = 232, "dsd"
	fmt.Println(kk, ll)

	//多行声明方式
	var (
		vv int  = 100
		jj bool = true
	)
	fmt.Println(vv, jj)
}
